from time import time
g=open('m1_sorted.txt')
y=open('m2_reverse.txt')
z=open('m3_shuffle.txt')
g_1=[int(i) for i in g]
y_1=[int(i) for i in y]
z_1=[int(i) for i in z]
n = len(g_1)
start=time()
for i in range(n-1):
	for j in range(n-i-1):
		if g_1[j+1]<g_1[j]:
		    g_1[j], g_1[j+1] = g_1[j+1],g_1[j]
end=time()
total=(end-start)*1000
print("m1_sorted",round(total), "milliseconds")
start=time()
k = len(y_1)
for i in range(k-1):
	for j in range(k-i-1):
		if y_1[j+1]<y_1[j]:
		    y_1[j], y_1[j+1] = y_1[j+1],y_1[j]
end=time()
total=(end-start)*1000
print("m2_reverse",round(total), "milliseconds")
start=time()
x = len(z_1)
for i in range(x):
	for j in range(x-i-1):
		if z_1[j+1]<z_1[j]:
		    z_1[j], z_1[j+1] = z_1[j+1],z_1[j]
end=time()
total=(end-start)*1000
print("m3_shuffle", round(total), "milliseconds")
